package com.huika.renrench.control.investment.activity;

import java.text.SimpleDateFormat;

import android.content.Intent;
import android.widget.TextView;

import com.huika.lib.utils.MoneyShowTool;
import com.huika.renrench.R;
import com.huika.renrench.control.common.base.BaseAct;
import com.huika.renrench.utils.DateTimeTool;
import com.huika.renrench.view.TitleBarHelper;

/**
 * 
 * @description：投资结果页面
 * @author zc
 * @date 2015年6月4日 下午3:34:54
 */
public class InvestResultActivity extends BaseAct {

	private String time;
	private String money;
	private TextView money_tv;
	private TextView time_tv;
	
	@Override
	public void setRootView() {
		setContentView(R.layout.activity_invest_result);
	}
	
	@Override
	protected void initData() {
		super.initData();
		TitleBarHelper barHelper = new TitleBarHelper(this, -1);
		barHelper.setLeftMsg("返回");
		barHelper.setTitleMsg("投资结果");
		Intent intent = getIntent();
		if(intent != null) {
			time = intent.getStringExtra("time");
			money = intent.getStringExtra("money");
		}
	}
	
	@Override
	protected void initWidget() {
		super.initWidget();
		money_tv = (TextView) findViewById(R.id.money_tv);
		time_tv = (TextView) findViewById(R.id.time_tv);
		long newTime = Long.parseLong(time) + 2 * 24 * 60 * 60;
		money_tv.setText(MoneyShowTool.twolastDF(Double.parseDouble(money)) + "元");
		time_tv.setText("明天开始计算收益，\n后天（ " + ((SimpleDateFormat)DateTimeTool.hotelDetailDf).format(newTime * 1000) + "）显示收益");
	}

}
